home *** CD-ROM | disk | FTP | other *** search
- /*
- Draw and Anim Lens Flare
- */
-
-
- options results
- parse ARG Port b
-
- ADDRESS value Port
- pp_ClearRange 0
-
- file="RAM:"
- option=0
-
- pp_DialogInit 250 90 "*Load*ASCII*GIMP*GRADIENT" 3
- pp_String 0 50 12 150 16 "Name" 1 100 file
- pp_Getfile 1 205 13 0 "Load*Gradient" 0 file
- pp_Cycle 2 100 32 100 16 "Range" 1 "1|2|3" option
- pp_Dialog
-
- rc=result
- if rc=0 then
- do
- EXIT
- end
-
- pp_GetDialog 0
- file=result
-
- pp_GetDialog 2
- option=result
-
- ADDRESS COMMAND
- IF OPEN('b',file,'R') then DO
- Title=READLN('b')
- Nb=READLN('b')
-
- DO j=0 to Nb-1
- T=READLN('b')
- P.0=trunc(substr(T,1,8)*19+0.5,0)
- P.1=trunc(substr(T,10,8)*19+0.5,0)
- P.2=trunc(substr(T,19,8)*19+0.5,0)
-
- R.0=substr(T,28,8)*255
- G.0=substr(T,37,8)*255
- B.0=substr(T,46,8)*255
- A.0=substr(T,55,8)*255
-
- R.2=substr(T,64,8)*255
- G.2=substr(T,73,8)*255
- B.2=substr(T,82,8)*255
- A.2=substr(T,91,8)*255
-
- R.1=R.0+(R.2-R.0)/2
- G.1=G.0+(G.2-G.0)/2
- B.1=B.0+(B.2-B.0)/2
- A.1=A.0+(A.2-A.0)/2
-
-
- ADDRESS value Port
-
- DO i=0 to 2
- R.i=trunc(R.i+0.5,0)
- G.i=trunc(G.i+0.5,0)
- B.i=trunc(B.i+0.5,0)
- A.i=255-trunc(A.i+0.5,0)
- pp_setRange option P.i R.i G.i B.i A.i
- END
- END
-
- EXIT
-
-